{extend name="public/base"}
{block name='main'}
<style type="text/css">
    .red {color: #FF5722!important;}
    .green {color: #5FB878!important;}
</style>
<fieldset class="layui-elem-field layui-field-title" style="margin-top:0px;">
    <legend>{$menuid|getmenuname}</legend>
</fieldset>
<div class="my-btn-box">
     <span class="fr">
       <a class="layui-btn layui-btn-normal" href="###">插件市场</a>
     </span>
</div>

<form class="layui-form layui-form-pane" action="">
    <table class="layui-table">
        <colgroup>
            <col width="60">
            <col width="150">
            <col width="150">
            <col width="">
            <col width="120">
            <col width="120">

            <col width="120">
            <col width="120">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>前台</th>
            <th>名称</th>
            <th>标识</th>
            <th>描述</th>
            <th>作者</th>
            <th>版本</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="userList">
        {volist name="list" id="val"}
        <tr>
            <td><span><a href="{$val.url}" target="_blank"> {$val.url}</a></span></td>
            <td><span>{$val.title}</span></td>
            <td><span>{$val.name}</span></td>
            <td><span>{$val.intro}</span></td>
            <td><span>{$val.author}</span></td>
            <td><span>{$val.version}</span></td>
            <td>
                <input type="checkbox" name="state" value="{$val.state}" data-uri="{:url('plugin/state',['name'=>$val.name,'state'=>$val.state,'force'=>0])}" lay-skin="switch" lay-filter="status" lay-text="启用|禁用"       {if ($val.state == 1)}checked{/if}>
            </td>
            <td>
                <a href="javascript:;" id="edit1" data-uri="{:url('plugin/config',['name'=>$val.name])}" data-title="插件配置"  data-id="edit" data-id="10">配置</a> |
                <a href="javascript:;"  id="delete" data-uri="{:url('plugin/uninstall',['name'=>$val.name,'force'=>0,'droptables'=>1])}" data-id="10">卸载</a>
                <a href="javascript:;" id="edit"  data-uri="{:url('plugin/install',['name'=>$val.name,'force'=>0,'droptables'=>1])}" data-id="10">安装</a>
            </td>
        </tr>
        {/volist}
        </tbody>

    </table>
</form>
<div id="test-laypage-demo0">
    <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-29">
        {//$list|raw}
    </div>
</div>

<script>
    layui.use(['layer','jquery','form','element','table'], function () {
        //参数：layui、名称、模块名、主键（删除用）
        //新增弹窗
        Oper.config.add.width = '800px';
        Oper.config.add.height = '600px';

        //编辑弹窗
        Oper.config.edit.width = '800px';
        Oper.config.edit.height = '600px';
        Oper.initList(layui, '插件', 'addons', 'id');
    });
</script>
{/block}